import service from '/@/utils/request';
import {DraftSaveOrUpdateDto, DraftVo} from "/@/types/views";

export const draftApi = {
    getDraft(draftId: number) {
        return service.get<DraftVo>(`/admin/draft/${draftId}`);
    },
    saveOrUpdateDraft(draftSaveOrUpdateDto: DraftSaveOrUpdateDto) {
        return service.post<DraftVo>(`/admin/draft/saveOrUpdate`, draftSaveOrUpdateDto);
    },
    deleteDraft(draftId: number) {
        return service.delete<boolean>(`/admin/draft/${draftId}`);
    },
}